package factoryGame;





import org.hibernate.Session;

import factory.Constants;
import game.constants.ReferenceAction;
import game.constants.ReferenceObject;
import game.constants.ReferenceSpecialFeature;
import interfaces.impl.HumanInteraction;
import objects.SpetialFeature;
import objects.WorldObject;


import actions.ActionActivateObject;
import actions.ActionCreateObject;
import actions.ActionDieTree;
import actions.ActionDropObject;
import actions.ActionEquipe;
import actions.ActionPickUpObject;
import actions.ActionReciveAttackTree;
import actions.ActionUnEquipe;
import actions.ActionUniverseTransport;
import agents.AgentAttack;
import agents.AgentAttackMonster;
import agents.AgentCreateObject;
import agents.AgentDie;
import agents.AgentFollow;
import agents.AgentMove;
import agents.AgentMoveMonster;
import agents.AgentTransportPlayer;
import agents.AgentTransportPlayer1;
import agents.interaction.InteractionAttackObject;
import agents.interaction.InteractionDropObject;
import agents.interaction.InteractionEquipeObject;
import agents.interaction.InteractionMovePlayer;
import agents.interaction.InteractionPickUpObject;
import agents.interaction.InteractionUnEquipeObject;
import agents.interaction.InteractionUsePotion;
import constants.ObjectType;
import database.MAction;
import database.MAgent;
import database.MSpecialFeature;
import database.MWorld;
import database.MWorldObject;
import extra.Position;

public final class ObjectFactory {
	
	//public static int objectID = 1;
	static HumanInteraction humanInteraction;
	static SpetialFeature feature;
	
	public final static WorldObject createWorldObject(int id, int idCliente,double x, double y, int assignSpecialFeature){
		WorldObject object= new WorldObject();
		MWorldObject mObject = new MWorldObject();
		//object.setID(objectID);
		//int objectID = (Integer) session.save(mObject);
		
		object.setObjectReference(id);
		object.setImageObject(ImageObjectFactory.createImageObject(id));
		System.out.println(object.getImageObject().getCollisionShape().getHeight());
		object.setOwner(idCliente);
		object.setPosition(new Position(x, y));
	
		
	
		
		//objectID++;
		
		switch (id){
			
		case ReferenceObject.OBJECT_REFERENCE_POTION:
			
			
			object.setObjectReference(id);
			
			
			object.addAction(new ActionActivateObject());

			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_USE_POTION));
//TODO			object.addAction(new ActionPickUpObject());
			object.addAction(new ActionDropObject());
			
			humanInteraction = new InteractionUsePotion();
			humanInteraction.setPermisology(constants.Constants.NO_PERMISOLOGY);
			object.addHumanInteraction(humanInteraction);
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
			feature = new SpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CAN_PICKUP));
			feature.setValue(constants.Constants.TRUE);
			object.addSpetialFeature(feature);
			
			
			break;
		
		case ReferenceObject.OBJECT_REFERENCE_PLAYER:
			
			object.setObjectReference(id);
			
			//adding actions
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MODIFY_SPETIAL_FEATURE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_XY_TO_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_RECIVE_ATTACK));
			
			object.addAction(new ActionDropObject());
			object.addAction(new ActionPickUpObject());
			object.addAction(new ActionUniverseTransport());
			
			//adding agents
			object.addAgent(new AgentMove());
			object.addAgent(new AgentAttack());
			object.addAgent(new AgentFollow());
			
			
			humanInteraction = new InteractionMovePlayer();
			//humanInteraction.setPermisology(objectID);
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionAttackObject();
		//	humanInteraction.setPermisology(objectID);
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionPickUpObject();
			//humanInteraction.setPermisology(objectID);
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionDropObject();
			//humanInteraction.setPermisology(objectID);
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionEquipeObject();
			///humanInteraction.setPermisology(objectID);
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionUnEquipeObject();
			///humanInteraction.setPermisology(objectID);
			object.addHumanInteraction(humanInteraction);
			
			
			System.out.println("asigno imagen al player");
			
			
//			//adding objcts
//			WorldObject potion = createWorldObject(ReferenceObject.OBJECT_REFERENCE_POTION,idCliente,x,y,assignSpecialFeature);
//			potion.setOwner(idCliente);
//			potion.setActive(false);
//			
//			WorldObject axe = createWorldObject(ReferenceObject.OBJECT_REFERENCE_AXE, idCliente, x, y,assignSpecialFeature);
//			axe.setOwner(idCliente);
//			axe.setActive(false);
//			
//			WorldObject dog =createWorldObject(ReferenceObject.OBJECT_REFERENCE_DOG, idCliente, x, y,assignSpecialFeature);
//			dog.setActive(false);
//			dog.setOwner(idCliente);
			
			
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			
//			object.addObject(potion);
//			object.addObject(dog);
//			object.addObject(axe);
			
			
			//adding special features
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.08);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
						
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(500);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(5);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(75);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(2000); //each two seconds;
			object.addSpetialFeature(feature);
			
			
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_MONSTER_1:
			
			//adding actions
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MODIFY_SPETIAL_FEATURE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_XY_TO_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_RECIVE_ATTACK));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_DIE));
			
			
			//adding agents
			object.addAgent(new AgentMove());
			object.addAgent(new AgentDie());
			object.addAgent(new AgentAttack());
			object.addAgent(new AgentAttackMonster());
			object.addAgent(new AgentMoveMonster());
			object.addAgent(new AgentFollow());
			
			
			if(assignSpecialFeature == constants.Constants.NO_ASSIGN_SPECIAL_FEATURE){
				break;
			}
			//adding special features
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.06);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(300);
			object.addSpetialFeature(feature);
			
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_BEGIN_AREA_TO_MOVE);
			feature.setValue(200);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_BEGIN_AREA_TO_MOVE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_END_AREA_TO_MOVE);
			feature.setValue(1000);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_END_AREA_TO_MOVE);
			feature.setValue(1000);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(40);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(40);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			feature.setValue(constants.Constants.NO_OBJECT_ID);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			feature.setValue(constants.Constants.NO_OBJECT_ID);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(5);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(50);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(2000); //each two seconds;
			object.addSpetialFeature(feature);
			
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_BONES:
			
			object.addAction(new ActionCreateObject());
			
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_REFERENCE_TO_REVIVE);
			feature.setValue(ReferenceObject.OBJECT_REFERENCE_MONSTER_1);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_MAX_NUMBER_OBJECTS_TO_CREATE);
			feature.setValue(0);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TIME_TO_REVIVE);
			feature.setValue(10000);
			object.addSpetialFeature(feature);
			
			
			object.addAgent(new AgentCreateObject());
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_FLOWER:
			
			object.addAction(new ActionActivateObject());
			object.addAction(new ActionDropObject());
			
			feature = new SpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CAN_PICKUP));
			feature.setValue(constants.Constants.TRUE);
			object.addSpetialFeature(feature);
			
			
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_AXE:
			
			
			
			object.setType(ObjectType.WEAPON);
			
			object.addAction(new ActionActivateObject());
			object.addAction(new ActionDropObject());
			object.addAction(new ActionEquipe());
			object.addAction(new ActionUnEquipe());
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setAditionalInfo(constants.Constants.FEATURE_TO_MODIFY);
			feature.setValue(20);
			object.addSpetialFeature(feature);
			
			feature = new SpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CAN_PICKUP));
			feature.setValue(constants.Constants.TRUE);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_EQUIPED);
			feature.setValue(Constants.FALSE);
			object.addSpetialFeature(feature);
			
			
			
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_TREE:
			
			object.addAction(new ActionReciveAttackTree());
			object.addAction(new ActionDieTree());
			
			object.addAgent(new AgentDie());
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			
			
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_DOG:
			
			object.addAction(new ActionDropObject());
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MODIFY_SPETIAL_FEATURE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_XY_TO_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_RECIVE_ATTACK));
			
			//adding special features
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.1);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(50);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(50);
			object.addSpetialFeature(feature);
						
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(400);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(10);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(50);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(1000); //each two seconds;
			object.addSpetialFeature(feature);
			
			//adding agents
			object.addAgent(new AgentMove());
			object.addAgent(new AgentAttack());
			object.addAgent(new AgentFollow());
			
			
			humanInteraction = new InteractionMovePlayer();
			//humanInteraction.setPermisology(objectID);
			object.addHumanInteraction(humanInteraction);
			
			humanInteraction = new InteractionAttackObject();
			//humanInteraction.setPermisology(objectID);			
			object.addHumanInteraction(humanInteraction);
			
			break;
			
		
		case ReferenceObject.OBJECT_REFERENCE_TREE1:
			
			object.addAction(new ActionReciveAttackTree());
			object.addAction(new ActionDieTree());
			
			object.addAgent(new AgentDie());
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_LAND:
		
			object.setIsBackground(Constants.TRUE);
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_STONE:
			
		
			break;
		case ReferenceObject.OBJECT_REFERENCE_SWORD:
			
			object.addAction(new ActionActivateObject());
			
			object.setType(ObjectType.WEAPON);
			
			
			object.addAction(new ActionDropObject());
			object.addAction(new ActionEquipe());
			object.addAction(new ActionUnEquipe());
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setAditionalInfo(constants.Constants.FEATURE_TO_MODIFY);
			feature.setValue(10);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setAditionalInfo(constants.Constants.FEATURE_TO_MODIFY);
			feature.setValue(-500);
			object.addSpetialFeature(feature);
			
			feature = new SpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CAN_PICKUP));
			feature.setValue(constants.Constants.TRUE);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_OBJECT_EQUIPED);
			feature.setValue(Constants.FALSE);
			object.addSpetialFeature(feature);
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_TABLE:
			
			
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_HOUSE1:
			
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_STATUE:
			
			
			
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_RAT:
			
			//adding actions
			
			object.addAction(new ActionActivateObject());
			object.addAction(new ActionDropObject());
			
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_MODIFY_SPETIAL_FEATURE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_XY_TO_MOVE));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_RECIVE_ATTACK));
			object.addAction(ActionFactory.getAction(ReferenceAction.ACTION_DIE));
			
			//adding special features
			feature = new SpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CAN_PICKUP));
			feature.setValue(constants.Constants.TRUE);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_TO_MOVE);
			feature.setValue(x);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_TO_MOVE);
			feature.setValue(y);
			object.addSpetialFeature(feature);
			
			object.addSpetialFeature(SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_IS_MOVING));
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_SPEED);
			feature.setValue(0.07);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_VISION_RANGE);
			feature.setValue(300);
			object.addSpetialFeature(feature);
			
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_BEGIN_AREA_TO_MOVE);
			feature.setValue(1);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_BEGIN_AREA_TO_MOVE);
			feature.setValue(1);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_X_END_AREA_TO_MOVE);
			feature.setValue(800);
			object.addSpetialFeature(feature);
			
			feature = SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_Y_END_AREA_TO_MOVE);
			feature.setValue(800);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_CURRENT_LIFE);
			feature.setValue(100);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_FOLLOW);
			feature.setValue(constants.Constants.NO_OBJECT_ID);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_TARGET_ID_TO_ATTACK);
			feature.setValue(constants.Constants.NO_OBJECT_ID);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_DAMAGE);
			feature.setValue(5);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_RANGE);
			feature.setValue(60);
			object.addSpetialFeature(feature);
			
			feature=SpetialFeatureFactory.getSpetialFeature(ReferenceSpecialFeature.SPETIAL_FEATURE_ATTACK_TIME);
			feature.setValue(2000); //each two seconds;
			object.addSpetialFeature(feature);
			
			//adding agents
			object.addAgent(new AgentMove());
			object.addAgent(new AgentDie());
		//	object.addAgent(new AgentAttack());
		//	object.addAgent(new AgentAttackMonster());
			object.addAgent(new AgentMoveMonster());
			
			
			
			
			break;

		case ReferenceObject.OBJECT_REFERENCE_TRASNPORT:
			
			
			
			object.setIsBackground(constants.Constants.TRUE);
			
			object.addAgent(new AgentTransportPlayer());
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_TRASNPORT1:
			
			
			
			object.setIsBackground(constants.Constants.TRUE);
			
			object.addAgent(new AgentTransportPlayer1());
			
			break;
			
		case ReferenceObject.OBJECT_REFERENCE_BACKGROUND_1:
			
			break;
		case ReferenceObject.OBJECT_REFERENCE_BACKGROUND_2:
			
			break;
		default:
			object.setObjectReference(ReferenceObject.OBJECT_REFERENCE_BACKGROUND_1);
			
			System.out.println("NO ENCUENTRO LA IMAGEN EN OBJECT FACTORY123123123");
			break;
			
		}
		
		
		
		
		return object;
		
	}
	
	
	
	
}
